package ModelLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class AdressBookTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class AdressBookTest
{
    private ModelLayer.AddressBook addressB1;
    private ModelLayer.Person person1;
    private ModelLayer.Person person2;
    private ModelLayer.Person person3;
    private ModelLayer.AddressBook addressB2;
    private ModelLayer.Person person4;

    /**
     * Default constructor for test class AdressBookTest
     */
    public AdressBookTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        addressB1 = new ModelLayer.AddressBook();
        person1 = new ModelLayer.Person();
        person1 = new ModelLayer.Person(1, "Anna", "street...", "9000", "Aalborg", "762379");
        person2 = new ModelLayer.Person(2, "Thomas", "street2..", "9200", "Skagen", "863412");
        person3 = new ModelLayer.Person(3, "Mary", "street3..", "8000", "Vejle", "92736");
        addressB2 = new ModelLayer.AddressBook();
        addressB2.addPerson(person1);
        addressB2.addPerson(person2);
        addressB2.addPerson(person3);
        addressB2.getAddressBook();
        addressB2.getPerson(1);
        person4 = new ModelLayer.Person(4, "ToBeRemoved", "adress", "00", "nowhere", "unavailable");
        addressB2.addPerson(person4);
        addressB2.getAddressBook();
        addressB2.deletePerson(4);
        addressB2.getAddressBook();
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
        
    }
    
    @Test
    public void run()
    {
        addressB1 = new ModelLayer.AddressBook();
        person1 = new ModelLayer.Person();
        person1 = new ModelLayer.Person(1, "Anna", "street...", "9000", "Aalborg", "762379");
        person2 = new ModelLayer.Person(2, "Thomas", "street2..", "9200", "Skagen", "863412");
        person3 = new ModelLayer.Person(3, "Mary", "street3..", "8000", "Vejle", "92736");
        addressB2 = new ModelLayer.AddressBook();
        addressB2.addPerson(person1);
        addressB2.addPerson(person2);
        addressB2.addPerson(person3);
        addressB2.getAddressBook();
        addressB2.getPerson(1);
        person4 = new ModelLayer.Person(4, "ToBeRemoved", "adress", "00", "nowhere", "unavailable");
        addressB2.addPerson(person4);
        addressB2.getAddressBook();
        addressB2.deletePerson(4);
        addressB2.getAddressBook();
    }

}

